home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / ANSI Headers / fcntl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-10  |  1.7 KB  |  67 lines  |  [TEXT/MMCC]

  1. /*
  2.  *    File:        fcntl.h
  3.  *                ©1993-1995 metrowerks Inc. All rights reserved
  4.  *    Author:        Berardino E. Baratta
  5.  *
  6.  *    Content:    Interface file to standard UNIX-style entry points ...
  7.  *
  8.  *    NB:            This file implements some UNIX low level support.  These functions
  9.  *                are not guaranteed to be 100% conformant.
  10.  */
  11.  
  12. #ifndef    _FCNTL
  13. #define    _FCNTL
  14.  
  15. #pragma options align=mac68k
  16.  
  17. /* local typedefs (used by creat) */
  18. typedef unsigned long    mode_t;
  19.  
  20. /*
  21.  *    Mode values accessible to open()
  22.  */
  23. #define O_RDWR            0x0            /* open the file in read/write mode */
  24. #define O_RDONLY        0x1            /* open the file in read only mode */
  25. #define O_WRONLY        0x2            /* open the file in write only mode */
  26. #define O_APPEND        0x0100        /* open the file in append mode */
  27. #define O_CREAT            0x0200        /* create the file if it doesn't exist */
  28. #define O_EXCL            0x0400        /* if the file already exists don't create it again */
  29. #define O_TRUNC            0x0800        /* truncate the file after opening it */
  30. #define O_NRESOLVE        0x1000        /* Don't resolve any aliases */
  31. #define O_ALIAS            0x2000        /* Open alias file (if the file is an alias) */
  32. #define O_RSRC             0x4000        /* Open the resource fork */
  33. #define O_BINARY        0x8000        /* open the file in binary mode (default is text mode) */
  34.  
  35. /*
  36.  *    Commands available to fcntl()
  37.  */
  38. #define F_DUPFD            0x0            /* return a duplicate file descriptor */
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. /*
  45.  *    Opens a file and returns it's id.
  46.  */
  47. int open(const char *path, int oflag);
  48.  
  49. /*
  50.  *    Creates and opens a file, returning the filenumber.  Note can only be used to set
  51.  *    binary mode (default is text mode) using O_BINARY
  52.  */
  53. int creat(const char *path, mode_t mode);
  54.  
  55. /*
  56.  *    File control routine.
  57.  */
  58. int fcntl(int fildes, int cmd, ...);
  59.  
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63.  
  64. #pragma options align=reset
  65.  
  66. #endif
  67.